UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jRqOazk8eNi7q9De2T/ZOZbbCc4gik01kdhNniZHVlE=' 
WHERE 
  key_id = '9f4ba8c3097e867402f4a5c77f326f7ee196a5388fecb3bac3071b29eecc8451' 
  AND (
    token = 'jRqOazk8eNi7q9De2T/ZOZbbCc4gik01kdhNniZHVlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063