UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k2RyHUTeirfu3/L0upW2QPxVEj8+5fNiBb+etxh85ak=' 
WHERE 
  key_id = 'e69ecc553c4bb6ae9e8b676226878666179b6c2dfc782b696ca1a4604b3df30e' 
  AND (
    token = 'k2RyHUTeirfu3/L0upW2QPxVEj8+5fNiBb+etxh85ak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029