UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yGxCGNAzLd2oee/2fOMSvr2HSatENVMa0QdpMvylz9U=' 
WHERE 
  key_id = '772e5593a545ff46297ebda933b9049c7b3157c2b393c519bceec0d69bfe3698' 
  AND (
    token = 'yGxCGNAzLd2oee/2fOMSvr2HSatENVMa0QdpMvylz9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025