UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lk9lEk4k/qOmpjbT6h/GYvXaozEMUS5b71YwWmd1Ccg=' 
WHERE 
  key_id = 'a4e0dc9c46c9217c1f4f6afa52d4a63bf3ccc3c18dd0a78caeadf4ba18e53a2d' 
  AND (
    token = 'Lk9lEk4k/qOmpjbT6h/GYvXaozEMUS5b71YwWmd1Ccg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026