UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YS3fMufy4fD2UfiFO2l+onBL5YdJcqxwCveTZBpYh04=' 
WHERE 
  key_id = '06f4cf22e092a8cb36d3a80f06260526fd51a259f087c980b1063bb91a80c65b' 
  AND (
    token = 'YS3fMufy4fD2UfiFO2l+onBL5YdJcqxwCveTZBpYh04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037