UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TmiQKFMrR4YZwN/BRCX6QHQvKuRh5feR8wXvDixukRo=' 
WHERE 
  key_id = '218d41299d9e1ce39b77f62eb27094c4fb32f2344662eb4d05d057ce0ed122bb' 
  AND (
    token = 'TmiQKFMrR4YZwN/BRCX6QHQvKuRh5feR8wXvDixukRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043