UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J/1wind77xGKmJ3LKay6r9GuNxVdlFlQb1hbgj3BliQ=' 
WHERE 
  key_id = '51d436f2f8f528161e8899f9951dd155c03f4daf1ee02999db4d93ab861659a4' 
  AND (
    token = 'J/1wind77xGKmJ3LKay6r9GuNxVdlFlQb1hbgj3BliQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036