UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GiPyfFROBRH3sxvdjMOP4g/2O29j8vS5sEzKWrRj44I='
WHERE
key_id = 'ec10933969d52af8cc9b868f7b756893b060a0d6952e6c11fe597e43718609aa'
AND (
token = 'GiPyfFROBRH3sxvdjMOP4g/2O29j8vS5sEzKWrRj44I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)