UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qxF0AfWtNG1cu5Gnl/qEuIx/WIpqvdeatqG7vnDw0MI=' 
WHERE 
  key_id = '2da39ad4cbbe6159a2e29206107551c99080f461b06b3881c8923a7be866115f' 
  AND (
    token = 'qxF0AfWtNG1cu5Gnl/qEuIx/WIpqvdeatqG7vnDw0MI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032