UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oetqp4c5vE3Xxj90Pzvbz+pr+xoLmOsLd2DeRnv97d8=' 
WHERE 
  key_id = '74b9a45cf138cb5f2f03d8dd1a5cbe6c48cc879a9f2e51376d1627d8362b6bc8' 
  AND (
    token = 'Oetqp4c5vE3Xxj90Pzvbz+pr+xoLmOsLd2DeRnv97d8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036