UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MWbSanoZxQdIQUIGe/gadiTqqe7B9C0hCuuk6bNYwr8=' 
WHERE 
  key_id = '18fb74db36fa35de12393c1a956562d9e75cdf8cd174193dd6671c035e824acb' 
  AND (
    token = 'MWbSanoZxQdIQUIGe/gadiTqqe7B9C0hCuuk6bNYwr8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026