UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nz7gLupKSInqvh8BrPmI1CiiG1ixfuA5gYuwYNicrKc='
WHERE
key_id = '15a506eea0bf7a8640d4ad9d6fe67c5bda45fe1e5fac06fbedfe3e4a3541de62'
AND (
token = 'Nz7gLupKSInqvh8BrPmI1CiiG1ixfuA5gYuwYNicrKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)