UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3IFmYLFNd5VJcXeOZjZx076bG+EQq0M/PPK2PUzGRAk=' 
WHERE 
  key_id = '49bf46427dd0b6542b835abe4cfbc8c05198378ee6aac2fc4259d7b2bc41b96d' 
  AND (
    token = '3IFmYLFNd5VJcXeOZjZx076bG+EQq0M/PPK2PUzGRAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029