UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w68QOGmdWC5qUVU5QkYPaJrh2GEWXjK+0NuC2zJh3yI='
WHERE
key_id = '4fe839355360503b5361c106dfd3e0518a2053d7c479e9d731e3d0de72f25400'
AND (
token = 'w68QOGmdWC5qUVU5QkYPaJrh2GEWXjK+0NuC2zJh3yI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)