UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8iK14nreyE/LeTktZTiMjHjNMUyFPQy2eY7SSV3GeRk='
WHERE
key_id = 'd6c832448dc1ad923e437e7e5fac0de011f2b3bfcdafb776466bd2e4b0463c42'
AND (
token = '8iK14nreyE/LeTktZTiMjHjNMUyFPQy2eY7SSV3GeRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)