UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GNjdK28OMoAwBdKNzdBKRV769/ZzTCQUoQb0EQAXIpw=' 
WHERE 
  key_id = 'af56dfddd42c99c1565235af423c8732e49ea9eac7c9d9ee53f078590ead61da' 
  AND (
    token = 'GNjdK28OMoAwBdKNzdBKRV769/ZzTCQUoQb0EQAXIpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022