UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j2TMM92QLUQt/+2cv0jrRkmJeN/PmzuwDfN07xpK/rU=' 
WHERE 
  key_id = 'ece20eb5dfcb95a75d528da9f657080c76bf4f14e2c764b5441d57a6df79f072' 
  AND (
    token = 'j2TMM92QLUQt/+2cv0jrRkmJeN/PmzuwDfN07xpK/rU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027