UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9VKNf9mG1DPxXgyNBXSYf4Lr/3WNHLHSlMwlGHsHb4M='
WHERE
key_id = '1d9770312835215d27f373fc8c2a76888a486205f196e90fdbf2748c090c5544'
AND (
token = '9VKNf9mG1DPxXgyNBXSYf4Lr/3WNHLHSlMwlGHsHb4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)