UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HXB+iYFxouyHXJqBvFTY4NkCAbrrGwAMkGwIKWWllJ8=' 
WHERE 
  key_id = '81cf60755b84e672741001da25c37abe9c4cd2d4a21e22002aef9f2cb50a7c6c' 
  AND (
    token = 'HXB+iYFxouyHXJqBvFTY4NkCAbrrGwAMkGwIKWWllJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038