UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QjkdC924QUoguPvF0q36yn3pkfp98LP3h9lpwBOMHDo=' 
WHERE 
  key_id = '2c9d5cf1ba9fb11843710bc209b8974ceece326e1b468249a1320f92e25b3e6b' 
  AND (
    token = 'QjkdC924QUoguPvF0q36yn3pkfp98LP3h9lpwBOMHDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039