UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WmCl4iFrVOQJJgh9G6B0d0yUsBJbnGUPfL4KIT6mNsY=' 
WHERE 
  key_id = '8f460e2a658b05abdab353abef4b7bb1aec23649101ac1c0f5b967d782063745' 
  AND (
    token = 'WmCl4iFrVOQJJgh9G6B0d0yUsBJbnGUPfL4KIT6mNsY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047