UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EC1g4mgFQ/8fMc8fDEFk+Ugsth8fGMBsTGfM9EnP4+c=' 
WHERE 
  key_id = '5f7262e8189a2f88a7bbd62d6d646fa0589831e8b5f835f593f051ae57e0a582' 
  AND (
    token = 'EC1g4mgFQ/8fMc8fDEFk+Ugsth8fGMBsTGfM9EnP4+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036