UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LB8uBpZLmv8AnAKIjk6KgE6F8zw6lU3IyN4XUkAlA70=' 
WHERE 
  key_id = '08f8cf70a7f17f4bb81b02f4219ceb4f23ac781c81d21acef83e937bc9fca096' 
  AND (
    token = 'LB8uBpZLmv8AnAKIjk6KgE6F8zw6lU3IyN4XUkAlA70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035