UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xFi8H9MkFnWXn9OjoU0cQZvbvQCSRUzVcBa+5xRjsPY=' 
WHERE 
  key_id = '2641a24fa6b82a809075507d39850b71f0a6418698f109ad5389d279bf96d577' 
  AND (
    token = 'xFi8H9MkFnWXn9OjoU0cQZvbvQCSRUzVcBa+5xRjsPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045