UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yp6yGwwIrXyj53Sv6SuDSnfMTlKaVFdu00BB5jmdoIo=' 
WHERE 
  key_id = '7a2221b6478283ce02d0c4cbc374d51fe88b619fb6fdb413fbf177ba75688eaf' 
  AND (
    token = 'Yp6yGwwIrXyj53Sv6SuDSnfMTlKaVFdu00BB5jmdoIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036