UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uSyXdAu1v+HXSyQmAtXp/8Eq/6scHd1iY7lM/fKue4o=' 
WHERE 
  key_id = 'c5883db99fba0024dcf485895fd6b9f1b8b048e1cf01b527f93db3d82f73a20d' 
  AND (
    token = 'uSyXdAu1v+HXSyQmAtXp/8Eq/6scHd1iY7lM/fKue4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050