UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '13fo8Z+AUhe3v6luftLXRMD5TgSsHwfGDz2jQV5rUBM=' 
WHERE 
  key_id = '967b39191697942124874d93ed840f5efc743bcde4d2522ccecb414f6214802f' 
  AND (
    token = '13fo8Z+AUhe3v6luftLXRMD5TgSsHwfGDz2jQV5rUBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039