UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jcEWBG+WKHPOH5egVMKwG4MGnJZpjphYgPhMAMOPnOU=' 
WHERE 
  key_id = 'fa21216567ba623ca96c202b823c86ef00a8f6cceb8742dfc453210b33700128' 
  AND (
    token = 'jcEWBG+WKHPOH5egVMKwG4MGnJZpjphYgPhMAMOPnOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032