UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qMkAG4imNn3DUgNEgV5dgk82CHAF6dDsQCAQJsbCTtQ=' 
WHERE 
  key_id = '6b4a2e36bf5aedd9ee45657a8da39e3cadd6f98f62a10c822010e9c4a7bce2ba' 
  AND (
    token = 'qMkAG4imNn3DUgNEgV5dgk82CHAF6dDsQCAQJsbCTtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035