UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '76mN5x6Mf2RAD2Ps4kbP16G0gS1kEBypxd/iiLM1cWY='
WHERE
key_id = 'efafcc77d114c573b6d572f76f6c5bb17ef81b8f8a0bf728d7c78624a74e081c'
AND (
token = '76mN5x6Mf2RAD2Ps4kbP16G0gS1kEBypxd/iiLM1cWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)