UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/F7HyFn06JS1quKnRteuVieObWXil+RJN+XHjmMWnSQ=' 
WHERE 
  key_id = 'ba41bbaeb155a4071396a93d8072fb652d6d36ab5edb476b9c41c02ccc0e99a2' 
  AND (
    token = '/F7HyFn06JS1quKnRteuVieObWXil+RJN+XHjmMWnSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033