UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9KBYayTc/fIoy5UxJYvL9i3CB47YodUZD+KOMHi7dL8=' 
WHERE 
  key_id = 'fcf73ce8e38ade4f31e2f78355a2c932a2ca0a9440ab5b8c74f411ac3feba957' 
  AND (
    token = '9KBYayTc/fIoy5UxJYvL9i3CB47YodUZD+KOMHi7dL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030