UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1IMBcZ43WTiKO3KNCgFzFc8GBw/TXbU5hjvLs8Z585I=' 
WHERE 
  key_id = '3253f4f2763e2da4d48d8dc439705bdbe1ad34353e4284c08977ceb59e37497c' 
  AND (
    token = '1IMBcZ43WTiKO3KNCgFzFc8GBw/TXbU5hjvLs8Z585I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034