UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DopDqUKX50nl+LYnen1UA/M5h7dd1rDMbMaI9DruFyE='
WHERE
key_id = 'c35f01b91a84eaf201b71e109f25049e42b2d228c54adaa638896a4e16e47e3d'
AND (
token = 'DopDqUKX50nl+LYnen1UA/M5h7dd1rDMbMaI9DruFyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)