UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W7VB+x+60WVhaunLK2Pnm+9Yep5RNpAs01Wd0MNe7X0=' 
WHERE 
  key_id = 'cdaec4b5cfcbd74e13ce00af0d80ad546d676ddd2f915541ff61751afdef9023' 
  AND (
    token = 'W7VB+x+60WVhaunLK2Pnm+9Yep5RNpAs01Wd0MNe7X0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029