UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DUJXEf6w/XlCKHWKmegP4FQhSHS9ewdIMlllyd2rn54=' 
WHERE 
  key_id = '1efff188b1ce33bfcda7d6e0c9626643ac696e24ebba05ef5f9798c56446c5f9' 
  AND (
    token = 'DUJXEf6w/XlCKHWKmegP4FQhSHS9ewdIMlllyd2rn54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018