UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PJZB32Pks5O0wpGtPRWeEcM8+sbux+b1ZOEi9QP5pI4=' 
WHERE 
  key_id = '1d6eafc3ebc2c110d93dc7f10df93c8ff32bb33ecdc5632fced2cbc419f3f4a0' 
  AND (
    token = 'PJZB32Pks5O0wpGtPRWeEcM8+sbux+b1ZOEi9QP5pI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049