UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eTmdEw3VnLkMpVJSsmpoZfDZqRuxCYWwxyTpLnmp1TI=' 
WHERE 
  key_id = '36bbfb7f3137bfe5f65ab01a6fc2102dafa36b647fa427f6d3a11fbb93694059' 
  AND (
    token = 'eTmdEw3VnLkMpVJSsmpoZfDZqRuxCYWwxyTpLnmp1TI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030