UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LEnx3rwcgPsWksRoG2PzaFJ50VP+Oe4pps12gxZYDqE=' 
WHERE 
  key_id = '6344bbf3f6c8325367b0ebf0fb1d6a5fe1fc0d3933151834a98be288a10f8619' 
  AND (
    token = 'LEnx3rwcgPsWksRoG2PzaFJ50VP+Oe4pps12gxZYDqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059