UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LEbtXpz7AM7+0MAMKXLqs+p4AOnFUnT4nPopGKGL4wM='
WHERE
key_id = '895bc4c77745faf6ca9d5b6c80c78c31bcac9d6f40a2d7a99b14808a314d86ca'
AND (
token = 'LEbtXpz7AM7+0MAMKXLqs+p4AOnFUnT4nPopGKGL4wM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)