UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eE6rdo8bldxw4BoVd/V7/LBuqawDvdpaADxThWBff6U=' 
WHERE 
  key_id = 'f7e9f755227524faf507acbec0f6708d70a8608cd05444e47e53c60fba45ae7d' 
  AND (
    token = 'eE6rdo8bldxw4BoVd/V7/LBuqawDvdpaADxThWBff6U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050