UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VNS/SvKxQmlpMp4Tow0Sas7YL+4twkjo8H/vrnIEdCQ=' 
WHERE 
  key_id = '46b3868b838b5f69589873da840c91d0cc2ed96c615e249d473ead22970f2c8c' 
  AND (
    token = 'VNS/SvKxQmlpMp4Tow0Sas7YL+4twkjo8H/vrnIEdCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034