UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2JcJ9Zo9sQ5gfzQJizhe00RFYtMoerAslYvhcHbirF4='
WHERE
key_id = '8d081ec87000e3ec3da3cf6a9208a9e1d6ac2bb226256dfbf1cc7ea24db07d17'
AND (
token = '2JcJ9Zo9sQ5gfzQJizhe00RFYtMoerAslYvhcHbirF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)