UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'euRkxWjvhE/oQDOp8EnqWCkbwe6+hHuS1B+5mm5C114=' 
WHERE 
  key_id = 'f756b0c8d9e9897a55ae2ce9310783392d679f287d8486ea17bae2c78211cbfc' 
  AND (
    token = 'euRkxWjvhE/oQDOp8EnqWCkbwe6+hHuS1B+5mm5C114=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026