UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'POMskYTIvH/Dg4tae+IukMhT8Y9fd3CiqUlBVlqAfgg='
WHERE
key_id = '8c93d2b8a837404b818010186f05887e262509510dfabd2eaeefd972ff5d1306'
AND (
token = 'POMskYTIvH/Dg4tae+IukMhT8Y9fd3CiqUlBVlqAfgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)