UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MU8asr1HYc69FOM4cwUIxFZTP5lnRDUVNF6bdJTnjEU=' 
WHERE 
  key_id = '9963319b69995f26f266fd569556f0ef0bd80ef952ff436551f541d9ede39840' 
  AND (
    token = 'MU8asr1HYc69FOM4cwUIxFZTP5lnRDUVNF6bdJTnjEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024