UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+zNikHpmbOMstpg0zxVmTqIjJQF1x/VGbbSSfgL7gro='
WHERE
key_id = 'cf4387ca228f33fb52c70ad4799abca32e36bae6f25b17a85a6bd0e9306c52c8'
AND (
token = '+zNikHpmbOMstpg0zxVmTqIjJQF1x/VGbbSSfgL7gro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)