UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yFPM4mUyWPUkHFt2++y+rHWJpmzTzxoy0cPk3C/gr7s='
WHERE
key_id = 'a691fe67b785dbd03b148d4d1d9658dc72eaf77de3acd9232ec415e99af5bab2'
AND (
token = 'yFPM4mUyWPUkHFt2++y+rHWJpmzTzxoy0cPk3C/gr7s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)