UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sAlt/Icr83+4bi8no86Fyu/vqMUP0nEUS9Ew3oECf0g=' 
WHERE 
  key_id = 'd5acf9264eb72dbc1f996e6baed57211170b484d9cf2af900c7864cd7c3ed34e' 
  AND (
    token = 'sAlt/Icr83+4bi8no86Fyu/vqMUP0nEUS9Ew3oECf0g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035