UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oorcjVFNHkkBk5GCWb3X5d2ks+5dNWCftTmqzoJGoa0='
WHERE
key_id = '784040fd3a33d80fc364c9d2ff1f2f407ecad6d499ebc8ea6792ccf81472c7e2'
AND (
token = 'oorcjVFNHkkBk5GCWb3X5d2ks+5dNWCftTmqzoJGoa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)