UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OBFEZ43spaKUI4Uk7amZ88Hho0Mt7hO8Mo7hwDuwg4U=' 
WHERE 
  key_id = 'de0712437b687a2cd62fae95bf50d34b002d14d96ab0886b685305de7ba377ea' 
  AND (
    token = 'OBFEZ43spaKUI4Uk7amZ88Hho0Mt7hO8Mo7hwDuwg4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031