UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jz8QFBrP6111/JYrWt71oGdEoXjkXFom7ZwIkkPGgg4=' 
WHERE 
  key_id = '46843d27c9d124c0860556368ca7990f511db729cc8c0fa00c45d59c5a260ce6' 
  AND (
    token = 'Jz8QFBrP6111/JYrWt71oGdEoXjkXFom7ZwIkkPGgg4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024