UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G6JWEvPAluRUi1NBZrZ96/jOkylhEgbWTN44+fGHGbw='
WHERE
key_id = '3c4b32f37700fdbaf36f99fe5444094c16dd0806b9a8bec046f4754bacde76cd'
AND (
token = 'G6JWEvPAluRUi1NBZrZ96/jOkylhEgbWTN44+fGHGbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)