UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TzIhqws+14d/XjvyZa+EuvVRqfe6BSosxqleF9/mmCM='
WHERE
key_id = 'bacabbc2e3c34e156462dbebba8475507918d884108b6038a6e47630cb34b72a'
AND (
token = 'TzIhqws+14d/XjvyZa+EuvVRqfe6BSosxqleF9/mmCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)