UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd9a6uVJ5nGuXyY7GMa/MVZu2h0swGaQO+USb5NiC5ws=' 
WHERE 
  key_id = 'bdc39162bda36cd6d2c9cdf6437349b7462d1eb32a70857af6e8e80cdb0343c0' 
  AND (
    token = 'd9a6uVJ5nGuXyY7GMa/MVZu2h0swGaQO+USb5NiC5ws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031