UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EcPeXvOOrOHO7D9gXMVEWNW1VGdERJQ7XyxugKAEMVw=' 
WHERE 
  key_id = 'd7da1cf1262f8747e40014dd93ce73df5e9917629a560051a5a152e787d6d434' 
  AND (
    token = 'EcPeXvOOrOHO7D9gXMVEWNW1VGdERJQ7XyxugKAEMVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031