UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BMTPSmTPqV7pmV7hSyI2Lwx2KgtXzAl0ZhyQ6MjOndQ=' 
WHERE 
  key_id = 'b9e596545e1aeb1132b71c963990dc38508c2d831e63bf614178cf7a5639b17d' 
  AND (
    token = 'BMTPSmTPqV7pmV7hSyI2Lwx2KgtXzAl0ZhyQ6MjOndQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055