UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M0XVX7fJs8LZ86v7VtT3hn9WCehCSJH1V5ArNp0cNYY='
WHERE
key_id = '45f90a2167052e8ac996edb727f6fc90d6b876bb40ecf1143631a5671f7276c5'
AND (
token = 'M0XVX7fJs8LZ86v7VtT3hn9WCehCSJH1V5ArNp0cNYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)