UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eQbFE2iMhgXIwM+/NomIW/giT3AdPqq3JbkqIkW7p2w=' 
WHERE 
  key_id = '7b7c890a921affd08675aecbb449d7e502ec2d03eff881bc403f3927c3fa458c' 
  AND (
    token = 'eQbFE2iMhgXIwM+/NomIW/giT3AdPqq3JbkqIkW7p2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027