UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TJdKCFa4wSTAPYjxk7VEZ+9DXd1ycPRxnSfWgDu3imY=' 
WHERE 
  key_id = '0076afcd7fc1a3cef70c5d7fd69b9e6f179b44da3d1f9ae92d1ae17c79bd1db1' 
  AND (
    token = 'TJdKCFa4wSTAPYjxk7VEZ+9DXd1ycPRxnSfWgDu3imY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040